<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
      document.body.onkeydown = function(e){
          var event = e;
          //上 38  下40  左37   右39  回车13  空格32  w 87 x88
      }  
        
        </script>
</body>
</html>